<script setup lang="ts">
import SysDialog from "@/components/SysDialog.vue";

import useDialog from "@/hooks/useDialog";
const { dialog, onClose, onConfirm } = useDialog();
const addBtn = () => {
  dialog.visible = true;
  dialog.title = "新增";
};
</script>

<template>
  <el-button type="primary" @click="addBtn">新增</el-button>
  <SysDialog
    :title="dialog.title"
    :width="dialog.width"
    :height="dialog.height"
    :visible="dialog.visible"
    @on-close="onClose"
    @on-confirm="onConfirm"
  >
    <template v-slot:content>
      <div>新增</div>
    </template>
  </SysDialog>
</template>

<style scoped>
:deep(.el-dialog) {
  background: transparent !important;
}
</style>
